package com.example.demo.web.api

import com.example.demo.data.Taco
import org.springframework.hateoas.RepresentationModel
import org.springframework.hateoas.server.core.Relation
import java.util.*


@Relation(value = "taco", collectionRelation = "tacos")
data class TacoResource(
        val name: String,
        val createdAt: Date,
        val ingredients: List<String>
): RepresentationModel<TacoResource>() {

    constructor(taco: Taco): this(taco.name, taco.createdAt, taco.ingredients)
}
